import Core from '@/core.js'
export default {
	data() {
		return {
			Core,
			pageList: [{
				commodityid: 1
			}, {
				commodityid: 2
			}, {
				commodityid: 3
			}, {
				commodityid: 4
			}, {
				commodityid: 5
			}, {
				commodityid: 6
			}],
			selectList: [],
			show: false,
			value: true,
			showShanchu: false,
			showXiajia: false,
		};
	},
	methods: {
		radioGroupChange(e) {
			console.log(e);
		},
		selectCom(id) {
			if(this.selectList.indexOf(id) === -1) {
				this.selectList.push(id)
			} else {
				this.selectList.splice(this.selectList.indexOf(id), 1)
			}
			if(this.selectList.length === this.pageList.length) {
				this.show = true
			} else {
				this.show = false
			}
		},
		allSelect(flag) {
			this.show = !flag
			this.selectList = []
			if (this.show) {
				this.pageList.forEach(item => {
					this.selectList.push(item.commodityid)
				})
			}
		},
		// scroll-view到底部加载更多
		onreachBottom() {
		
		},
	}
}
